-- GENERATED SPELL FOR [Eredar Soul-Eater] --


function spell0_20879(pUnit, Event) --@Entropic Aura,Self--
pUnit:FullCastSpellOnTarget(36784,pUnit)
pUnit:RegisterEvent('Sorts_20879', 565, 1)
end

function spell1_20879(pUnit, Event) --@Soul Chill,Self--
pUnit:FullCastSpellOnTarget(36786,pUnit)
pUnit:RegisterEvent('Sorts_20879', 8323, 1)
end

function spell2_20879(pUnit, Event) --@Soul Chill,Self--
pUnit:FullCastSpellOnTarget(38843,pUnit)
pUnit:RegisterEvent('Sorts_20879', 8280, 1)
end

function spell3_20879(pUnit, Event) --@Soul Steal,n/a--
pUnit:FullCastSpellOnTarget(36778,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20879', 20325, 1)
end

function Sorts_20879(pUnit, Event)
local choix_sorts_20879 = math.random(0, 3)
if choix_sorts_20879 == 0 then
pUnit:RegisterEvent('spell0_20879', 1, 1)
end
if choix_sorts_20879 == 1 then
pUnit:RegisterEvent('spell1_20879', 1, 1)
end
if choix_sorts_20879 == 2 then
pUnit:RegisterEvent('spell2_20879', 1, 1)
end
if choix_sorts_20879 == 3 then
pUnit:RegisterEvent('spell3_20879', 1, 1)
end
end

function mob20879_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20879', math.random(1500, 3000), 1)
end

function mob20879_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20879_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20879_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20879, 1, 'mob20879_Action')
RegisterUnitEvent(20879, 2, 'mob20879_Leave')
RegisterUnitEvent(20879, 3, 'mob20879_Kill')
RegisterUnitEvent(20879, 4, 'mob20879_Die')
